package com.esri.core.tasks.ags.geoprocessing;

import java.util.Date;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class GPDate extends GPParameter {
    private static final long serialVersionUID = 1;
    private Date value;

    public GPDate(String str) {
        setParamName(str);
        this.dataType = "GPDate";
    }

    public GPDate() {
        this("");
    }

    public Date getValue() {
        return this.value;
    }

    public void setValue(Date date) {
        this.value = date;
    }

    @Override // com.esri.core.tasks.ags.geoprocessing.GPParameter
    public String generateValueParams() {
        return String.valueOf(this.value.getTime());
    }

    @Override // com.esri.core.tasks.ags.geoprocessing.GPParameter
    public void fromJson(JsonParser jsonParser) throws Exception {
        if (jsonParser.getCurrentToken() == JsonToken.VALUE_NUMBER_INT) {
            this.value = new Date(jsonParser.getLongValue());
        }
    }

    public int hashCode() {
        Date date = this.value;
        return 31 + (date == null ? 0 : date.hashCode());
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            GPDate gPDate = (GPDate) obj;
            Date date = this.value;
            if (date == null) {
                if (gPDate.value != null) {
                    return false;
                }
            } else if (!date.equals(gPDate.value)) {
                return false;
            }
            return true;
        }
        return false;
    }

    public String toString() {
        return "GPDate [value=" + this.value + "]";
    }
}
